package com.demo.demo.entity;

import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.methods.multipart.FilePart;
import org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity;
import org.apache.commons.httpclient.methods.multipart.Part;
import org.apache.commons.httpclient.params.HttpMethodParams;

import java.io.File;
import java.io.IOException;
import java.util.HashMap;

public class Demo {


    public static void main(String[] args) throws IOException {
        int numn = 1<<30;
        int h;
        int num=(h = "112".hashCode()) ^ (h >>> 16);
        int number = 256336 ^ 0;
int nb = (h >>> 16);
int nl ="112".hashCode();
        System.out.println(number);
        System.out.println(nl);
        System.out.println(nb);
        System.out.println(num);
        System.out.println(numn);
        /*String url = "http://127.0.0.1:8110/base/business-diary-manual/import";
        String pathname = new File("logs" + File.separator + "export (1).xls").getCanonicalPath();
        logUpload(url, pathname);*/
    }


    private static void logUpload(String url, String pathname) {
        HttpClient httpClient = new HttpClient();
        PostMethod postMethod = new PostMethod(url);

        try {
            FilePart filePart = new FilePart("file", new File(pathname));
            Part[] parts = {filePart};

            MultipartRequestEntity multipartRequestEntity = new MultipartRequestEntity(parts, new HttpMethodParams());
            postMethod.setRequestEntity(multipartRequestEntity);
            httpClient.executeMethod(postMethod);
            String result = postMethod.getResponseBodyAsString();

            System.out.println(result);
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            postMethod.releaseConnection();
        }
    }

}
